﻿using System;
using System.Collections;
using System.Text;

namespace Cinema.Model
{
    class Saloon
    {
        //vars
        private int rows;
        private int seats;
        private String signature;
        int[][] seatScheme;
        //vars
       
        //constructor
        public Saloon(int rows, int seats, String signature)
        {
            this.rows = rows;
            this.seats = seats;
            int ratio = seats / rows;
            seatScheme = new int[rows][];
            int index = 0;
            while (index < seatScheme.GetLength(1))
            {
                if (index == (seatScheme.GetLength(1) - 1))
                {
                    seatScheme[index] = new int[seats%rows];
                }
                else
                {
                    seatScheme[index] = new int[ratio];
                }
                index++;
            }
            index = 0;
            int rowSeatCounter = 0;
            int genericSeatCounter = 0;
            while (true)
            {
                seatScheme[index][rowSeatCounter] = genericSeatCounter;
            }
            this.signature = signature;
        }
        //constructor

        public int Seats
        {
            get { return seats; }
            set { seats = value; }
        }

        public String Signature
        {
            get { return signature; }
            set { signature = value; }
        }

        public int getRows()
        {
            return rows;
        }
    }
}
